<!DOCTYPE html>

<html lang="en">
  <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>分页（Pagination） &mdash; Phalcon 2.0.0 文档</title>
    <meta name="keywords" content="php, phalcon, phalcon php, php framework, faster php framework"><link rel="stylesheet" type="text/css" href="../_static/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="http://static.phalconphp.com/css/phalcon.min.css" />
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400' rel='stylesheet' type='text/css'>
    <link href="http://fonts.googleapis.com/css?family=Merriweather:400,700" rel="stylesheet" type="text/css" />
    <!--
    EUROPE <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=latin-ext' rel='stylesheet' type='text/css'>
    GREEK <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=greek-ext' rel='stylesheet' type='text/css'>
    RUSSIA <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=cyrillic-ext,latin' rel='stylesheet' type='text/css'>
    -->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/docs.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.0.0',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>

    <script src="../_static/jquery.min.js"></script>
    <script type="text/javascript" src="../_static/docs.js"></script>
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="top" title="Phalcon 2.0.0 文档" href="../index.html" />
    <link rel="next" title="使用缓存提高性能（Improving Performance with Cache）" href="cache.html" />
    <link rel="prev" title="读取配置（Reading Configurations）" href="config.html" /> 
  </head>
  <body>

<header class="page-header">
    <nav class="navbar" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-menu-container">
                    <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
                </button>
                <a class="navbar-brand phalcon-logo" href="/"><span itemprop="name" class="sr-only">Phalcon PHP</span></a>
            </div>

            <div class="collapse navbar-collapse navbar-right" id="main-menu-container">
                <ul class="nav navbar-nav main-menu">
                  <li class="first"><a href="http://phalconphp.com/en/download" class="header-nav-link">Download</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/index.html" class="header-nav-link" target="_blank">Documentation</a></li>
                  <li><a href="http://forum.phalconphp.com/" class="header-nav-link" target="_blank">Forum</a></li>
                  <li><a href="http://blog.phalconphp.com/" class="header-nav-link" target="_blank">Blog</a></li>
                  <li><a href="http://phalconphp.com/en/about">About</a></li>
                </ul>
            </div>
        </div>
    </nav>
  </header>

<div class="heading">
    <div class="container">
        <div class="row">
            <h2>Documentation</h2>
        </div>
    </div>
</div>
    <!--<div class="header-line">
      <div class="size-wrap">
        <div class="header-line-title title-white">Documentation</div>
      </div>
    </div>-->
    <div class="related">
      <ul>
        <li class="right" >
          <a href="../genindex.html" title="总目录"
             accesskey="I">索引</a></li>
        <li class="right" >
          <a href="cache.html" title="使用缓存提高性能（Improving Performance with Cache）"
             accesskey="N">下一页</a> |</li>
        <li class="right" >
          <a href="config.html" title="读取配置（Reading Configurations）"
             accesskey="P">上一页</a> |</li>
        <li><a href="http://phalconphp.com">Home</a> &raquo;</li>
        <li><a href="../index.html">Phalcon 2.0.0 文档</a> &raquo;</li> 
      </ul>
    </div>  

      <table width="100%" align="center" cellpadding="0" cellspacing="0">
        <tr>
      <td class="primary-box" width="25%" valign="top">
            <div>
            <div id="searchbox" style="">
                <!--<form class="search" action="http://readthedocs.org/search/project/" method="get">
                  <input type="search" name="q" size="25" placeholder="Search">
                  <input type="submit" value="Go">
                  <input type="hidden" name="selected_facets" value="project:">
                </form>-->
                <div style="width:200px;padding:10px">
                  <gcse:searchbox-only></gcse:searchbox-only>
                </div>
            </div>
            </div>
            <div style="padding:5px;padding-left:10px">
              <div id="carbonads-container">
                <div class="carbonad"><div id="azcarbon"></div>
                <script type="text/javascript">var z = document.createElement("script"); z.type = "text/javascript"; z.async = true; z.src = "http://engine.carbonads.com/z/56496/azcarbon_2_1_0_VERT"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(z, s);</script>
                </div></div>
            </div>
            <h3><a href="../index.html">內容目录</a></h3>
            <ul>
<li><a class="reference internal" href="#">分页（Pagination）</a><ul>
<li><a class="reference internal" href="#data-adapters">数据适配器（Data Adapters）</a></li>
<li><a class="reference internal" href="#examples">示例（Examples）</a></li>
<li><a class="reference internal" href="#adapters-usage">适配器使用（Adapters Usage）</a></li>
<li><a class="reference internal" href="#page-attributes">页面属性（Page Attributes）</a></li>
<li><a class="reference internal" href="#implementing-your-own-adapters">自定义适配器（Implementing your own adapters）</a></li>
</ul>
</li>
</ul>

            <h4>上一个主题</h4>
            <p class="topless"><a href="config.html" title="上一章">&lt; 读取配置（Reading Configurations）</a></p>
            <h4>下一个主题</h4>
            <p class="topless"><a href="cache.html" title="下一章">使用缓存提高性能（Improving Performance with Cache） &gt;</a></p>
            <h3>本页</h3>
            <ul class="this-page-menu">
              <li><a href="../_sources/reference/pagination.txt" rel="nofollow">显示源代码</a></li>
            </ul>
        </td>
          <td class="second-box" valign="top">
            <div class="document">
                <div class="documentwrapper">
                  <div class="bodywrapper">
                    <div class="body" >
                      
  <div class="section" id="pagination">
<h1>分页（Pagination）<a class="headerlink" href="#pagination" title="永久链接至标题">¶</a></h1>
<p>The process of pagination takes place when we need to present big groups of arbitrary data gradually. Phalcon\Paginator offers a
fast and convenient way to split these sets of data browsable pages.</p>
<div class="section" id="data-adapters">
<h2>数据适配器（Data Adapters）<a class="headerlink" href="#data-adapters" title="永久链接至标题">¶</a></h2>
<p>This component makes use of adapters to encapsulate different sources of data:</p>
<table border="1" class="docutils">
<colgroup>
<col width="7%" />
<col width="93%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Adapter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>NativeArray</td>
<td>Use a PHP array as source data</td>
</tr>
<tr class="row-odd"><td>Model</td>
<td>Use a Phalcon\Mvc\Model\Resultset object as source data. Since PDO doesn&#8217;t support scrollable cursors this adapter shouldn&#8217;t be used to paginate a large number of records</td>
</tr>
<tr class="row-even"><td>QueryBuilder</td>
<td>Use a Phalcon\Mvc\Model\Query\Builder object as source data</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="examples">
<h2>示例（Examples）<a class="headerlink" href="#examples" title="永久链接至标题">¶</a></h2>
<p>In the example below, the paginator will use as its source data the result of a query from a model, and limit the displayed data to 10 records per page:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="c1">// Current page to show</span>
<span class="c1">// In a controller this can be:</span>
<span class="c1">// $this-&gt;request-&gt;getQuery(&#39;page&#39;, &#39;int&#39;); // GET</span>
<span class="c1">// $this-&gt;request-&gt;getPost(&#39;page&#39;, &#39;int&#39;); // POST</span>
<span class="nv">$currentPage</span> <span class="o">=</span> <span class="p">(</span><span class="nx">int</span><span class="p">)</span> <span class="nv">$_GET</span><span class="p">[</span><span class="s2">&quot;page&quot;</span><span class="p">];</span>

<span class="c1">// The data set to paginate</span>
<span class="nv">$robots</span>      <span class="o">=</span> <span class="nx">Robots</span><span class="o">::</span><span class="na">find</span><span class="p">();</span>

<span class="c1">// Create a Model paginator, show 10 rows by page starting from $currentPage</span>
<span class="nv">$paginator</span>   <span class="o">=</span> <span class="k">new</span> <span class="nx">PaginatorModel</span><span class="p">(</span>
    <span class="k">array</span><span class="p">(</span>
        <span class="s2">&quot;data&quot;</span>  <span class="o">=&gt;</span> <span class="nv">$robots</span><span class="p">,</span>
        <span class="s2">&quot;limit&quot;</span> <span class="o">=&gt;</span> <span class="mi">10</span><span class="p">,</span>
        <span class="s2">&quot;page&quot;</span>  <span class="o">=&gt;</span> <span class="nv">$currentPage</span>
    <span class="p">)</span>
<span class="p">);</span>

<span class="c1">// Get the paginated results</span>
<span class="nv">$page</span> <span class="o">=</span> <span class="nv">$paginator</span><span class="o">-&gt;</span><span class="na">getPaginate</span><span class="p">();</span>
</pre></div>
</div>
<p>Variable $currentPage controls the page to be displayed. The $paginator-&gt;getPaginate() returns a $page
object that contains the paginated data. It can be used for generating the pagination:</p>
<div class="highlight-html+php"><div class="highlight"><pre><span class="nt">&lt;table&gt;</span>
    <span class="nt">&lt;tr&gt;</span>
        <span class="nt">&lt;th&gt;</span>Id<span class="nt">&lt;/th&gt;</span>
        <span class="nt">&lt;th&gt;</span>Name<span class="nt">&lt;/th&gt;</span>
        <span class="nt">&lt;th&gt;</span>Type<span class="nt">&lt;/th&gt;</span>
    <span class="nt">&lt;/tr&gt;</span>
    <span class="cp">&lt;?php</span> <span class="k">foreach</span> <span class="p">(</span><span class="nv">$page</span><span class="o">-&gt;</span><span class="na">items</span> <span class="k">as</span> <span class="nv">$item</span><span class="p">)</span> <span class="p">{</span> <span class="cp">?&gt;</span>
    <span class="nt">&lt;tr&gt;</span>
        <span class="nt">&lt;td&gt;</span><span class="cp">&lt;?php</span> <span class="k">echo</span> <span class="nv">$item</span><span class="o">-&gt;</span><span class="na">id</span><span class="p">;</span> <span class="cp">?&gt;</span><span class="nt">&lt;/td&gt;</span>
        <span class="nt">&lt;td&gt;</span><span class="cp">&lt;?php</span> <span class="k">echo</span> <span class="nv">$item</span><span class="o">-&gt;</span><span class="na">name</span><span class="p">;</span> <span class="cp">?&gt;</span><span class="nt">&lt;/td&gt;</span>
        <span class="nt">&lt;td&gt;</span><span class="cp">&lt;?php</span> <span class="k">echo</span> <span class="nv">$item</span><span class="o">-&gt;</span><span class="na">type</span><span class="p">;</span> <span class="cp">?&gt;</span><span class="nt">&lt;/td&gt;</span>
    <span class="nt">&lt;/tr&gt;</span>
    <span class="cp">&lt;?php</span> <span class="p">}</span> <span class="cp">?&gt;</span>
<span class="nt">&lt;/table&gt;</span>
</pre></div>
</div>
<p>The $page object also contains navigation data:</p>
<div class="highlight-html+php"><div class="highlight"><pre><span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">&quot;/robots/search&quot;</span><span class="nt">&gt;</span>First<span class="nt">&lt;/a&gt;</span>
<span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">&quot;/robots/search?page=</span><span class="cp">&lt;?</span><span class="o">=</span> <span class="nv">$page</span><span class="o">-&gt;</span><span class="na">before</span><span class="p">;</span> <span class="cp">?&gt;</span><span class="s">&quot;</span><span class="nt">&gt;</span>Previous<span class="nt">&lt;/a&gt;</span>
<span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">&quot;/robots/search?page=</span><span class="cp">&lt;?</span><span class="o">=</span> <span class="nv">$page</span><span class="o">-&gt;</span><span class="na">next</span><span class="p">;</span> <span class="cp">?&gt;</span><span class="s">&quot;</span><span class="nt">&gt;</span>Next<span class="nt">&lt;/a&gt;</span>
<span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">&quot;/robots/search?page=</span><span class="cp">&lt;?</span><span class="o">=</span> <span class="nv">$page</span><span class="o">-&gt;</span><span class="na">last</span><span class="p">;</span> <span class="cp">?&gt;</span><span class="s">&quot;</span><span class="nt">&gt;</span>Last<span class="nt">&lt;/a&gt;</span>

<span class="cp">&lt;?php</span> <span class="k">echo</span> <span class="s2">&quot;You are in page &quot;</span><span class="p">,</span> <span class="nv">$page</span><span class="o">-&gt;</span><span class="na">current</span><span class="p">,</span> <span class="s2">&quot; of &quot;</span><span class="p">,</span> <span class="nv">$page</span><span class="o">-&gt;</span><span class="na">total_pages</span><span class="p">;</span> <span class="cp">?&gt;</span>
</pre></div>
</div>
</div>
<div class="section" id="adapters-usage">
<h2>适配器使用（Adapters Usage）<a class="headerlink" href="#adapters-usage" title="永久链接至标题">¶</a></h2>
<p>An example of the source data that must be used for each adapter:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">use</span> <span class="nx">Phalcon\Paginator\Adapter\Model</span> <span class="k">as</span> <span class="nx">PaginatorModel</span><span class="p">;</span>
<span class="k">use</span> <span class="nx">Phalcon\Paginator\Adapter\NativeArray</span> <span class="k">as</span> <span class="nx">PaginatorArray</span><span class="p">;</span>
<span class="k">use</span> <span class="nx">Phalcon\Paginator\Adapter\QueryBuilder</span> <span class="k">as</span> <span class="nx">PaginatorQueryBuilder</span><span class="p">;</span>

<span class="c1">//Passing a resultset as data</span>
<span class="nv">$paginator</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">PaginatorModel</span><span class="p">(</span>
    <span class="k">array</span><span class="p">(</span>
        <span class="s2">&quot;data&quot;</span>  <span class="o">=&gt;</span> <span class="nx">Products</span><span class="o">::</span><span class="na">find</span><span class="p">(),</span>
        <span class="s2">&quot;limit&quot;</span> <span class="o">=&gt;</span> <span class="mi">10</span><span class="p">,</span>
        <span class="s2">&quot;page&quot;</span>  <span class="o">=&gt;</span> <span class="nv">$currentPage</span>
    <span class="p">)</span>
<span class="p">);</span>

<span class="c1">//Passing an array as data</span>
<span class="nv">$paginator</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">PaginatorArray</span><span class="p">(</span>
    <span class="k">array</span><span class="p">(</span>
        <span class="s2">&quot;data&quot;</span>  <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span>
            <span class="k">array</span><span class="p">(</span><span class="s1">&#39;id&#39;</span> <span class="o">=&gt;</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">&#39;name&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Artichoke&#39;</span><span class="p">),</span>
            <span class="k">array</span><span class="p">(</span><span class="s1">&#39;id&#39;</span> <span class="o">=&gt;</span> <span class="mi">2</span><span class="p">,</span> <span class="s1">&#39;name&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Carrots&#39;</span><span class="p">),</span>
            <span class="k">array</span><span class="p">(</span><span class="s1">&#39;id&#39;</span> <span class="o">=&gt;</span> <span class="mi">3</span><span class="p">,</span> <span class="s1">&#39;name&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Beet&#39;</span><span class="p">),</span>
            <span class="k">array</span><span class="p">(</span><span class="s1">&#39;id&#39;</span> <span class="o">=&gt;</span> <span class="mi">4</span><span class="p">,</span> <span class="s1">&#39;name&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Lettuce&#39;</span><span class="p">),</span>
            <span class="k">array</span><span class="p">(</span><span class="s1">&#39;id&#39;</span> <span class="o">=&gt;</span> <span class="mi">5</span><span class="p">,</span> <span class="s1">&#39;name&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;&#39;</span><span class="p">)</span>
        <span class="p">),</span>
        <span class="s2">&quot;limit&quot;</span> <span class="o">=&gt;</span> <span class="mi">2</span><span class="p">,</span>
        <span class="s2">&quot;page&quot;</span>  <span class="o">=&gt;</span> <span class="nv">$currentPage</span>
    <span class="p">)</span>
<span class="p">);</span>

<span class="c1">//Passing a querybuilder as data</span>

<span class="nv">$builder</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">modelsManager</span><span class="o">-&gt;</span><span class="na">createBuilder</span><span class="p">()</span>
    <span class="o">-&gt;</span><span class="na">columns</span><span class="p">(</span><span class="s1">&#39;id, name&#39;</span><span class="p">)</span>
    <span class="o">-&gt;</span><span class="na">from</span><span class="p">(</span><span class="s1">&#39;Robots&#39;</span><span class="p">)</span>
    <span class="o">-&gt;</span><span class="na">orderBy</span><span class="p">(</span><span class="s1">&#39;name&#39;</span><span class="p">);</span>

<span class="nv">$paginator</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">PaginatorQueryBuilder</span><span class="p">(</span><span class="k">array</span><span class="p">(</span>
    <span class="s2">&quot;builder&quot;</span> <span class="o">=&gt;</span> <span class="nv">$builder</span><span class="p">,</span>
    <span class="s2">&quot;limit&quot;</span>   <span class="o">=&gt;</span> <span class="mi">20</span><span class="p">,</span>
    <span class="s2">&quot;page&quot;</span>    <span class="o">=&gt;</span> <span class="mi">1</span>
<span class="p">));</span>
</pre></div>
</div>
</div>
<div class="section" id="page-attributes">
<h2>页面属性（Page Attributes）<a class="headerlink" href="#page-attributes" title="永久链接至标题">¶</a></h2>
<p>The $page object has the following attributes:</p>
<table border="1" class="docutils">
<colgroup>
<col width="19%" />
<col width="81%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Attribute</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>items</td>
<td>The set of records to be displayed at the current page</td>
</tr>
<tr class="row-odd"><td>current</td>
<td>The current page</td>
</tr>
<tr class="row-even"><td>before</td>
<td>The previous page to the current one</td>
</tr>
<tr class="row-odd"><td>next</td>
<td>The next page to the current one</td>
</tr>
<tr class="row-even"><td>last</td>
<td>The last page in the set of records</td>
</tr>
<tr class="row-odd"><td>total_pages</td>
<td>The number of pages</td>
</tr>
<tr class="row-even"><td>total_items</td>
<td>The number of items in the source data</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="implementing-your-own-adapters">
<h2>自定义适配器（Implementing your own adapters）<a class="headerlink" href="#implementing-your-own-adapters" title="永久链接至标题">¶</a></h2>
<p>The <a class="reference internal" href="../api/Phalcon_Paginator_AdapterInterface.html"><em>Phalcon\Paginator\AdapterInterface</em></a> interface must be implemented in order to create your own paginator adapters or extend the existing ones:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">use</span> <span class="nx">Phalcon\Paginator\AdapterInterface</span> <span class="k">as</span> <span class="nx">PaginatorInterface</span><span class="p">;</span>

<span class="k">class</span> <span class="nc">MyPaginator</span> <span class="k">implements</span> <span class="nx">PaginatorInterface</span>
<span class="p">{</span>

    <span class="sd">/**</span>
<span class="sd">     * Adapter constructor</span>
<span class="sd">     *</span>
<span class="sd">     * @param array $config</span>
<span class="sd">     */</span>
    <span class="k">public</span> <span class="k">function</span> <span class="nf">__construct</span><span class="p">(</span><span class="nv">$config</span><span class="p">);</span>

    <span class="sd">/**</span>
<span class="sd">     * Set the current page number</span>
<span class="sd">     *</span>
<span class="sd">     * @param int $page</span>
<span class="sd">     */</span>
    <span class="k">public</span> <span class="k">function</span> <span class="nf">setCurrentPage</span><span class="p">(</span><span class="nv">$page</span><span class="p">);</span>

    <span class="sd">/**</span>
<span class="sd">     * Returns a slice of the resultset to show in the pagination</span>
<span class="sd">     *</span>
<span class="sd">     * @return stdClass</span>
<span class="sd">     */</span>
    <span class="k">public</span> <span class="k">function</span> <span class="nf">getPaginate</span><span class="p">();</span>

<span class="p">}</span>
</pre></div>
</div>
</div>
</div>


                    </div>
                  </div>
                </div>
            </div>
          </td>
        </tr>
      </table>
    <div class="related">
      <ul>
        <li class="right" >
          <a href="../genindex.html" title="总目录"
             >索引</a></li>
        <li class="right" >
          <a href="cache.html" title="使用缓存提高性能（Improving Performance with Cache）"
             >下一页</a> |</li>
        <li class="right" >
          <a href="config.html" title="读取配置（Reading Configurations）"
             >上一页</a> |</li> 
      </ul>
    </div>

      <div class="prefooter">
  <div class="container">
      <div class="row">
          <div class="col-sm-3 text-right">
              <span>Follow along:</span>
          </div>
          <div class="col-sm-6 text-center">
              <a href="https://twitter.com/phalconphp" alt="Twitter" class="btn-social btn-social-twitter"><i class="icon-twitter"></i></a>
              <a href="https://www.facebook.com/pages/Phalcon-Framework/134230726685897" alt="Facebook" class="btn-social btn-social-facebook"><i class="icon-facebook"></i></a>
              <a href="https://plus.google.com/102376109340560896457" alt="Google+" class="btn-social btn-social-googleplus"><i class="icon-googleplus"></i></a>
              <a href="https://github.com/phalcon/cphalcon" alt="Github" class="btn-social btn-social-github"><i class="icon-github"></i></a>
          </div>
          <div class="col-sm-3">
          </div>
      </div>
  </div>

</div>
<footer class="footer">
  <div class="container">
      <div class="row">
          <div class="col-xs-4 col-sm-3">
              <h4>Download</h4>
              <ul>
                  <li><a href="http://phalconphp.com/download">Installing Phalcon</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/index.html" class="header-nav-link" target="_blank">Documentation</a></li>
                  <li><a href="http://api.phalconphp.com">API</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/reference/tutorial.html">Tutorial</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/reference/tutorial.html#sample-applications">Sample Applications</a></li>
              </ul>
          </div>
          <div class="col-xs-4 col-sm-3">
              <h4>Community</h4>
              <ul>
                  <li><a href="http://forum.phalconphp.com/" class="header-nav-link" target="_blank">Forum</a></li>
                  <li><a href="https://github.com/phalcon/cphalcon">GitHub</a></li>
                  <li><a href="https://github.com/phalcon/cphalcon/issues">Issue Tracker</a></li>
                  <li><a href="http://stackoverflow.com/questions/tagged/phalcon">Stack Overflow</a></li>
                  <li><a href="http://phalconphp.com/en/testimonials">Testimonials</a></li>
                  <li><a href="http://builtwith.phalconphp.com/">Built with Phalcon</a></li>
                  <li><a href="http://store.phalconphp.com/">Store</a></li>
              </ul>
          </div>
          <div class="col-xs-4 col-sm-2">
              <h4>About</h4>
              <ul>
                  <li><a class="link-black" href="http://blog.phalconphp.com/">Blog</a></li>
                  <li><a href="http://phalconphp.com/en/about">About</a></li>
                  <li><a href="http://phalconphp.com/en/team">Team</a></li>
                  <li><a href="http://phalconphp.com/en/roadmap">Roadmap</a></li>
                  <li><a href="http://phalconphp.com/en/donate">Donate</a></li>
                  <li><a href="http://phalconphp.com/en/consulting">Consulting</a></li>
                  <li><a href="http://phalconphp.com/en/hosting">Hosting</a></li>
              </ul>
          </div>
          <div id="license-spaccer" class="visible-xs"></div>
          <div id="license-wrapper" class="col-xs-12 col-sm-4">
              <p class="license">

                  Found a typo or an error? Want to improve this document? The documentation sources are available on <a href="http://github.com/phalcon/docs">Github</a><br>
                  Need support or have questions? Check our <a href="http://forum.phalconphp.com">Forum</a><br>
                  <br>

                  Phalcon Framework is released under the <a href="https://github.com/phalcon/cphalcon/blob/master/docs/LICENSE.md">new BSD license</a>.<br>
                  Except where otherwise noted, content on this site is licensed under the
                    <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 License.</a>

                <div class="design">
                  <span>Designed by:</span>

                  <a href="http://www.fog-city.net/" class="fogcity" target="_blank" title="Fog City Software"><span>Fog City Software</span></a>
              </div>
          </div>
      </div>
  </div>
</footer>

    </div>
    <script type="text/javascript">
    $(window).on("load", function(){
      var cx = '009733439235723428699:lh9ltjgvdz8';
      var gcse = document.createElement('script');
      gcse.type = 'text/javascript';
      gcse.async = true;
      gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx;
      var s = document.getElementsByTagName('script')[0];
      s.parentNode.insertBefore(gcse, s);
    });
    </script>

  </body>
</html>